src = $(wildcard ./src/main/*.cpp)
src += $(wildcard ./src/log/*.cpp)
nodir_src = $(notdir $(src))
obj = $(patsubst %.cpp,%.o,$(src))

DEFS = -DLIBVA_SUPPORT -DLIBVA_DRM_SUPPORT
CFLAGS += $(DEFS)
myArgs = -g -w -std=c++11 -fPIC $(CFLAGS)

INC_PATH=-I./include \
         -I./include/log4cpp/ \
         -I./include/json/ \
         -I./headfile/common \
         -I./headfile/log \

LIB_PATH=./lib/libjsoncpp.a \
         -L./lib/log4cpp/ -llog4cpp \
		 -lpthread -lrt -ldl \
#LIB_PATH+=-L./lib/ -Wl,-rpath=./lib/qt599/

EXEC=./bin/aods
ALL:$(EXEC)

#链接
$(EXEC):$(obj)
	g++ $^ -o $@ $(LIB_PATH)
	@echo ${obj}
#编译
$(obj):./%.o:./%.cpp
	@echo ${obj}
	@echo ${src}
	g++ -c $^ -o $@ $(myArgs) $(INC_PATH)

clean:
	-rm -rf $(obj) $(EXEC)

#伪目标
.PHONY: clean ALL